home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / SCSL / ccfftmr.z / ccfftmr
Encoding:
Text File  |  2002-10-03  |  31.3 KB  |  727 lines

  1.  
  2.  
  3.  
  4. CCCCCCCCFFFFFFFFTTTTMMMMRRRR((((3333SSSS))))                                                        CCCCCCCCFFFFFFFFTTTTMMMMRRRR((((3333SSSS))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      CCCCCCCCFFFFFFFFTTTTMMMMRRRR, ZZZZZZZZFFFFFFFFTTTTMMMMRRRR - Applies multiple complex-to-complex Fast Fourier
  10.      Transforms (FFTs) to the rows of a two-dimensional (2D) array
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      Single precision complex -> Single precision complex
  14.  
  15.           Fortran:
  16.                CCCCAAAALLLLLLLL CCCCCCCCFFFFFFFFTTTTMMMMRRRR ((((_i_s_i_g_n,,,, _n,,,, _l_o_t,,,, _s_c_a_l_e,,,, _x,,,, _l_d_x,,,, _y,,,, _l_d_y,,,, _t_a_b_l_e,,,,
  17.                _w_o_r_k,,,, _i_s_y_s))))
  18.  
  19.           C/C++:
  20.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  21.                iiiinnnntttt ccccccccffffffffttttmmmmrrrr ((((iiiinnnntttt _i_s_i_g_n,,,, iiiinnnntttt _n,,,, iiiinnnntttt _l_o_t,,,, ffffllllooooaaaatttt _s_c_a_l_e,,,,
  22.                ssssccccssssllll____ccccoooommmmpppplllleeeexxxx *_x,,,, iiiinnnntttt _l_d_x,,,, ssssccccssssllll____ccccoooommmmpppplllleeeexxxx *_y,,,, iiiinnnntttt _l_d_y,,,, ffffllllooooaaaatttt
  23.                *_t_a_b_l_e,,,, ffffllllooooaaaatttt *_w_o_r_k,,,, iiiinnnntttt *_i_s_y_s))));;;;
  24.  
  25.           C++ STL:
  26.                ####iiiinnnncccclllluuuuddddeeee <<<<ccccoooommmmpppplllleeeexxxx....hhhh>>>>
  27.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  28.                iiiinnnntttt ccccccccffffffffttttmmmmrrrr ((((iiiinnnntttt *_i_s_i_g_n,,,, iiiinnnntttt *_n,,,, iiiinnnntttt *_l_o_t,,,, ffffllllooooaaaatttt *_s_c_a_l_e,,,,
  29.                ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>> *_x,,,, iiiinnnntttt *_l_d_x,,,, ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>> *_y,,,, iiiinnnntttt *_l_d_y,,,, ffffllllooooaaaatttt
  30.                *_t_a_b_l_e,,,, ffffllllooooaaaatttt *_w_o_r_k,,,, iiiinnnntttt *_i_s_y_s))));;;;
  31.  
  32.      Double precision complex -> Double precision complex
  33.  
  34.           Fortran:
  35.                CCCCAAAALLLLLLLL ZZZZZZZZFFFFFFFFTTTTMMMMRRRR ((((_i_s_i_g_n,,,, _n,,,, _l_o_t,,,, _s_c_a_l_e,,,, _x,,,, _l_d_x,,,, _y,,,, _l_d_y,,,, _t_a_b_l_e,,,,
  36.                _w_o_r_k,,,, _i_s_y_s))))
  37.  
  38.           C/C++:
  39.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  40.                iiiinnnntttt zzzzzzzzffffffffttttmmmmrrrr ((((iiiinnnntttt _i_s_i_g_n,,,, iiiinnnntttt _n,,,, iiiinnnntttt _l_o_t,,,, ddddoooouuuubbbblllleeee _s_c_a_l_e,,,,
  41.                ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx *_x,,,, iiiinnnntttt _l_d_x,,,, ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx *_y,,,, iiiinnnntttt _l_d_y,,,, ddddoooouuuubbbblllleeee
  42.                *_t_a_b_l_e,,,, ddddoooouuuubbbblllleeee *_w_o_r_k,,,, iiiinnnntttt *_i_s_y_s))));;;;
  43.  
  44.           C++ STL:
  45.                ####iiiinnnncccclllluuuuddddeeee <<<<ccccoooommmmpppplllleeeexxxx....hhhh>>>>
  46.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  47.                iiiinnnntttt zzzzzzzzffffffffttttmmmmrrrr ((((iiiinnnntttt *_i_s_i_g_n,,,, iiiinnnntttt *_n,,,, iiiinnnntttt *_l_o_t,,,, ddddoooouuuubbbblllleeee *_s_c_a_l_e,,,,
  48.                ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>> *_x,,,, iiiinnnntttt *_l_d_x,,,, ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>> *_y,,,, iiiinnnntttt *_l_d_y,,,,
  49.                ddddoooouuuubbbblllleeee *_t_a_b_l_e,,,, ddddoooouuuubbbblllleeee *_w_o_r_k,,,, iiiinnnntttt *_i_s_y_s))));;;;
  50.  
  51. IIIIMMMMPPPPLLLLEEEEMMMMEEEENNNNTTTTAAAATTTTIIIIOOOONNNN
  52.      These routines are part of the SCSL Scientific Library and can be loaded
  53.      using either the ----llllssssccccssss or the ----llllssssccccssss____mmmmpppp option.  The ----llllssssccccssss____mmmmpppp option
  54.      directs the linker to use the multi-processor version of the library.
  55.  
  56.      When linking to SCSL with ----llllssssccccssss or ----llllssssccccssss____mmmmpppp, the default integer size is
  57.      4 bytes (32 bits). Another version of SCSL is available in which integers
  58.      are 8 bytes (64 bits).  This version allows the user access to larger
  59.      memory sizes and helps when porting legacy Cray codes.  It can be loaded
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. CCCCCCCCFFFFFFFFTTTTMMMMRRRR((((3333SSSS))))                                                        CCCCCCCCFFFFFFFFTTTTMMMMRRRR((((3333SSSS))))
  71.  
  72.  
  73.  
  74.      by using the ----llllssssccccssss____iiii8888 option or the ----llllssssccccssss____iiii8888____mmmmpppp option. A program may use
  75.      only one of the two versions; 4-byte integer and 8-byte integer library
  76.      calls cannot be mixed.
  77.  
  78.      The C and C++ prototypes shown above are appropriate for the 4-byte
  79.      integer version of SCSL. When using the 8-byte integer version, the
  80.      variables of type iiiinnnntttt become lllloooonnnngggg lllloooonnnngggg and the <<<<ssssccccssssllll____fffffffftttt____iiii8888....hhhh>>>> header
  81.      file should be included.
  82.  
  83. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  84.      CCCCCCCCFFFFFFFFTTTTMMMMRRRR/ZZZZZZZZFFFFFFFFTTTTMMMMRRRR computes the FFT of each row of the complex matrix _X, and
  85.      stores the results in the rows of complex matrix _Y.
  86.  
  87.      Suppose the arrays are declared as follows:
  88.  
  89.           Fortran:
  90.  
  91.                COMPLEX X(0:ldx-1, 0:n-1)
  92.                COMPLEX Y(0:ldy-1, 0:n-1)
  93.  
  94.  
  95.           C/C++:
  96.  
  97.                scsl_complex x[n][ldx], y[n][ldy];
  98.  
  99.  
  100.           C++ STL:
  101.  
  102.                complex<float> x[n][ldx], y[n][ldy];
  103.  
  104.  
  105.      where _l_d_x >= _l_o_t, _l_d_y >= _l_o_t.
  106.  
  107.      Then row _L of the output array is the FFT of row _L of the input array,
  108.      using the following formula for the FFT:
  109.  
  110.                      n-1        isign * j * k
  111.      Y     = scale * Sum [X  * w              ]
  112.       k,L            j=0    j
  113.  
  114.  
  115.      for _k = 0, ..., _n-1
  116.          _L = 0, ..., _l_o_t-1
  117.  
  118.      where:
  119.  
  120.      _w         = exp(2*_p_i*_i/_n),
  121.  
  122.      _i         = + sqrt(-1),
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. CCCCCCCCFFFFFFFFTTTTMMMMRRRR((((3333SSSS))))                                                        CCCCCCCCFFFFFFFFTTTTMMMMRRRR((((3333SSSS))))
  137.  
  138.  
  139.  
  140.      _p_i        = 3.14159...,
  141.  
  142.      _i_s_i_g_n     = +1 or -1
  143.  
  144.      _l_o_t       = the number of rows to transform
  145.  
  146.      Different authors use different conventions for which of the transforms,
  147.      _i_s_i_g_n = +1 or _i_s_i_g_n = -1, is the forward or inverse transform, and what
  148.      the _s_c_a_l_e factor should be in either case.  You can make this routine
  149.      compute any of the various possible definitions, however, by choosing the
  150.      appropriate values for _i_s_i_g_n and _s_c_a_l_e.
  151.  
  152.      The relevant fact from FFT theory is this:  If you take the FFT with any
  153.      particular values of _i_s_i_g_n and _s_c_a_l_e, the mathematical inverse function
  154.      is computed by taking the FFT with -_i_s_i_g_n and 1/(_n * _s_c_a_l_e).  In
  155.      particular, if you use _i_s_i_g_n = +1 and _s_c_a_l_e = 1.0 for the forward FFT,
  156.      you can compute the inverse FFT by using the following:  _i_s_i_g_n = -1 and
  157.      _s_c_a_l_e = 1.0/_n.
  158.  
  159.      See the NOTES section of this man page for information about the
  160.      interpretation of the data types described in the following arguments.
  161.  
  162.      This routine has the following arguments:
  163.  
  164.      _i_s_i_g_n     Integer.  (input)
  165.                Specifies whether to initialize the _t_a_b_l_e array or to do the
  166.                forward or inverse Fourier transform, as follows:
  167.  
  168.                If _i_s_i_g_n = 0, the routine initializes _t_a_b_l_e and returns.  In
  169.                this case, the only arguments used or checked are _i_s_i_g_n, _n, and
  170.                _t_a_b_l_e.
  171.  
  172.                If _i_s_i_g_n = +1 or -1, the value of _i_s_i_g_n is the sign of the
  173.                exponent used in the FFT formula.
  174.  
  175.      _n         Integer.  (input)
  176.                Size of each transform (the number of elements in each row of
  177.                the input and output matrix to be transformed). _n >= 0; if _n =
  178.                0, the routine returns.
  179.  
  180.      _l_o_t       Integer.   (input)
  181.                The number of transforms to be computed (lot size).  This is
  182.                the number of elements in each column of the input and output
  183.                matrix.  _l_o_t >= 0.  If _l_o_t = 0, the routine returns.
  184.  
  185.      _s_c_a_l_e     Scale factor. (input)
  186.                CCCCCCCCFFFFFFFFTTTTMMMMRRRR: Single precision.
  187.                ZZZZZZZZFFFFFFFFTTTTMMMMRRRR: Double precision.
  188.                Each element of the output array is multiplied by the _s_c_a_l_e
  189.                factor after taking the Fourier transform, as defined
  190.                previously.
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. CCCCCCCCFFFFFFFFTTTTMMMMRRRR((((3333SSSS))))                                                        CCCCCCCCFFFFFFFFTTTTMMMMRRRR((((3333SSSS))))
  203.  
  204.  
  205.  
  206.      _x         Array of dimensions (_l_d_x, _n).   (input)
  207.                CCCCCCCCFFFFFFFFTTTTMMMMRRRR: Single precision complex array.
  208.                ZZZZZZZZFFFFFFFFTTTTMMMMRRRR: Double precision complex array.
  209.                Input array of values to be transformed.
  210.  
  211.      _l_d_x       Integer.   (input)
  212.                The number of rows in _x, as it was declared in the calling
  213.                program (the leading dimension of _X).  _l_d_x >= MMMMAAAAXXXX(_l_o_t, 1).
  214.  
  215.      _y         Array of dimensions (_l_d_y, _n).   (output)
  216.                CCCCCCCCFFFFFFFFTTTTMMMMRRRR: Single precision complex array.
  217.                ZZZZZZZZFFFFFFFFTTTTMMMMRRRR: Double precision complex array.
  218.                Output array of transformed values.  Each row of the output
  219.                array, _y, is the FFT of the corresponding row of the input
  220.                array, _x, computed according to the preceding formula.
  221.  
  222.                The output array may be the same as the input array. In that
  223.                case, the transform is done in place.  The input array is
  224.                overwritten with the transformed values.  In this case, it is
  225.                necessary that _l_d_x = _l_d_y.
  226.  
  227.      _l_d_y       Integer.   (input)
  228.                The number of rows in the _Y array, as it was declared in the
  229.                calling program (the leading dimension of _Y).  _l_d_y >= MMMMAAAAXXXX(_l_o_t,
  230.                1).
  231.  
  232.      _t_a_b_l_e     Array of dimension (2 * _n +  _N_F) (input or output)
  233.                CCCCCCCCFFFFFFFFTTTTMMMMRRRR: Single precision array.
  234.                ZZZZZZZZFFFFFFFFTTTTMMMMRRRR: Double precision array.
  235.                Table of factors and roots of unity.  See the description of
  236.                the _i_s_y_s argument for the value of _N_F.
  237.  
  238.                If _i_s_i_g_n = 0, the routine initializes _t_a_b_l_e (_t_a_b_l_e is output
  239.                only).
  240.  
  241.                If _i_s_i_g_n = +1 or -1, the values in _t_a_b_l_e are assumed to be
  242.                initialized already by a prior call with _i_s_i_g_n = 0 (_t_a_b_l_e is
  243.                input only).
  244.  
  245.      _w_o_r_k      Array of dimension (2 * _n).
  246.                CCCCCCCCFFFFFFFFTTTTMMMM: Single precision array.
  247.                ZZZZZZZZFFFFFFFFTTTTMMMM: Double precision array.
  248.                Work array.  This is a scratch array used for intermediate
  249.                calculations.  Its address space must be different from the
  250.                input and output arrays.
  251.  
  252.      _i_s_y_s      Integer array dimensioned 0000........_i_s_y_s((((0000)))).
  253.                An array that gives implementation-specific information.  All
  254.                features and functions of the FFT routines specific to any
  255.                particular implementation are confined to this _i_s_y_s array.
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. CCCCCCCCFFFFFFFFTTTTMMMMRRRR((((3333SSSS))))                                                        CCCCCCCCFFFFFFFFTTTTMMMMRRRR((((3333SSSS))))
  269.  
  270.  
  271.  
  272.                In the Origin series implementation, _i_s_y_s((((0000))))====0000 and _i_s_y_s((((0000))))====1111
  273.                are supported.  In SCSL versions prior to 1.3, only _i_s_y_s((((0000))))====0000
  274.                was allowed. For _i_s_y_s((((0000))))====0000, _N_F====33330000, and for _i_s_y_s((((0000))))====1111, _N_F====222255556666.
  275.                The _N_F words of storage in the _t_a_b_l_e array contain a
  276.                factorization of the length of the transform.
  277.  
  278.                The smaller value of _N_F for _i_s_y_s((((0000))))====0000 is historical. It is too
  279.                small to store all the required factors for the highest
  280.                performing FFT, so when _i_s_y_s((((0000))))====0000, extra space is allocated
  281.                when the _t_a_b_l_e array is initialized. To avoid memory leaks,
  282.                this extra space must be deallocated when the _t_a_b_l_e array is no
  283.                longer needed. The CCCCCCCCFFFFFFFFTTTTMMMMRRRRFFFF routine is used to release this
  284.                memory. Due to the potential for memory leaks, the use of
  285.                _i_s_y_s((((0000))))====0000 should be avoided.
  286.  
  287.                For _i_s_y_s((((0000))))====1111, the value of _N_F is large enough so that no extra
  288.                memory needs to be allocated, and there is no need to call
  289.                CCCCCCCCFFFFFFFFTTTTMMMMRRRRFFFF to release memory. If called, it does nothing.
  290.  
  291.                NOTE: _i_s_y_s((((0000))))====1111 means that _i_s_y_s is an integer array with two
  292.                elements. The second element, _i_s_y_s((((1111)))), will not be accessed.
  293.  
  294. NNNNOOOOTTTTEEEESSSS
  295.      The following data types are described in this documentation:
  296.  
  297.           TTTTeeeerrrrmmmm UUUUsssseeeedddd                     DDDDaaaattttaaaa ttttyyyyppppeeee
  298.  
  299.      Fortran:
  300.  
  301.           Array dimensioned 0000........_n----1111      XXXX((((0000::::nnnn----1111))))
  302.  
  303.           Array of dimensions (_m,_n)     XXXX((((mmmm,,,,nnnn))))
  304.  
  305.           Array of dimensions (_m,_n,_p)   XXXX((((mmmm,,,,nnnn,,,,pppp))))
  306.  
  307.           Integer                       IIIINNNNTTTTEEEEGGGGEEEERRRR (IIIINNNNTTTTEEEEGGGGEEEERRRR****8888 for ----llllssssccccssss____iiii8888[[[[____mmmmpppp]]]])
  308.  
  309.           Single precision              RRRREEEEAAAALLLL
  310.  
  311.           Double precision              DDDDOOOOUUUUBBBBLLLLEEEE PPPPRRRREEEECCCCIIIISSSSIIIIOOOONNNN
  312.  
  313.           Single precision complex      CCCCOOOOMMMMPPPPLLLLEEEEXXXX
  314.  
  315.           Double precision complex      DDDDOOOOUUUUBBBBLLLLEEEE CCCCOOOOMMMMPPPPLLLLEEEEXXXX
  316.  
  317.      C/C++:
  318.  
  319.           Array dimensioned 0000........_n----1111      xxxx[[[[_n]]]]
  320.  
  321.           Array of dimensions (_m,_n)     xxxx[[[[mmmm****nnnn]]]] oooorrrr xxxx[[[[nnnn]]]][[[[mmmm]]]]
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. CCCCCCCCFFFFFFFFTTTTMMMMRRRR((((3333SSSS))))                                                        CCCCCCCCFFFFFFFFTTTTMMMMRRRR((((3333SSSS))))
  335.  
  336.  
  337.  
  338.           Array of dimensions (_m,_n,_p)   xxxx[[[[mmmm****nnnn****pppp]]]] oooorrrr xxxx[[[[pppp]]]][[[[nnnn]]]][[[[mmmm]]]]
  339.  
  340.           Integer                       iiiinnnntttt (lllloooonnnngggg lllloooonnnngggg for ----llllssssccccssss____iiii8888[[[[____mmmmpppp]]]])
  341.  
  342.           Single precision              ffffllllooooaaaatttt
  343.  
  344.           Double precision              ddddoooouuuubbbblllleeee
  345.  
  346.           Single precision complex      ssssccccssssllll____ccccoooommmmpppplllleeeexxxx
  347.  
  348.           Double precision complex      ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx
  349.  
  350.      C++ STL:
  351.  
  352.           Array dimensioned 0000........_n----1111      xxxx[[[[_n]]]]
  353.  
  354.           Array of dimensions (_m,_n)     xxxx[[[[mmmm****nnnn]]]] oooorrrr xxxx[[[[nnnn]]]][[[[mmmm]]]]
  355.  
  356.           Array of dimensions (_m,_n,_p)   xxxx[[[[mmmm****nnnn****pppp]]]] oooorrrr xxxx[[[[pppp]]]][[[[nnnn]]]][[[[mmmm]]]]
  357.  
  358.           Integer                       iiiinnnntttt (lllloooonnnngggg lllloooonnnngggg for ----llllssssccccssss____iiii8888[[[[____mmmmpppp]]]])
  359.  
  360.           Single precision              ffffllllooooaaaatttt
  361.  
  362.           Double precision              ddddoooouuuubbbblllleeee
  363.  
  364.           Single precision complex      ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>>
  365.  
  366.           Double precision complex      ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>>
  367.  
  368. CCCCAAAAUUUUTTTTIIIIOOOONNNNSSSS
  369.      Transform sizes with a prime factor exceeding 22223332222----1111 are not supported for
  370.      the 8-byte integer version of the library.
  371.  
  372.      In addition to the _w_o_r_k array, the FFT routines also dynamically allocate
  373.      scratch space from the stack. The amount of space allocated can be
  374.      slightly bigger than the size of the largest processor cache. For single
  375.      processor runs, the default stack size is large enough that these
  376.      allocations generally cause no problems. But for parallel runs, you need
  377.      to ensure that the stack size of slave threads is big enough to hold this
  378.      scratch space. Failure to reserve sufficient stack space will cause
  379.      programs to dump core due to stack overflows.  The stack size of MP
  380.      library slave threads is controlled via the MMMMPPPP____SSSSLLLLAAAAVVVVEEEE____SSSSTTTTAAAACCCCKKKKSSSSIIIIZZZZEEEE
  381.      environment variable or the mmmmpppp____sssseeeetttt____ssssllllaaaavvvveeee____ssssttttaaaacccckkkkssssiiiizzzzeeee(((()))) library routine. See
  382.      the mmmmpppp(3C), mmmmpppp(3F) and ppppeeee____eeeennnnvvvviiiirrrroooonnnn(5) reference pages for more information
  383.      on controlling the slave stack size. For pthreads applications, the
  384.      thread's stack size is specified as one of many creation attributes
  385.      provided in the pthread_attr_t argument to pppptttthhhhrrrreeeeaaaadddd____ccccrrrreeeeaaaatttteeee(3P).  The
  386.      stacksize attribute should be set explicitly to a non-default value using
  387.      the pppptttthhhhrrrreeeeaaaadddd____aaaattttttttrrrr____sssseeeettttssssttttaaaacccckkkkssssiiiizzzzeeee(3P) call, described in the
  388.      pppptttthhhhrrrreeeeaaaadddd____aaaattttttttrrrr____iiiinnnniiiitttt(3P) man page.
  389.  
  390.  
  391.  
  392.  
  393.                                                                         PPPPaaaaggggeeee 6666
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. CCCCCCCCFFFFFFFFTTTTMMMMRRRR((((3333SSSS))))                                                        CCCCCCCCFFFFFFFFTTTTMMMMRRRR((((3333SSSS))))
  401.  
  402.  
  403.  
  404.      Care must be exercised if copies of the _t_a_b_l_e array are used: even though
  405.      a copy exists, the original must persist. As an example, the following
  406.      code will nnnnooootttt work:
  407.  
  408.           #include <scsl_fft.h>
  409.           scsl_complex x[131][65], y[131][65];
  410.           float table[2*128 + 256];
  411.           float work[2*128];
  412.           int isys[2];
  413.           isys[0] = 1;
  414.           {
  415.              float table_orig[2*128 + 256];
  416.  
  417.              ccfftmr(0, 128, 64, 1.0f, (scsl_complex *) x, 65,
  418.                     (scsl_complex *) y, 65, table_orig, work, isys);
  419.              bcopy(table_orig, table, (2*128+256)*sizeof(float));
  420.           }
  421.           ccfftmr(1, 128, 64, 1.0f, (scsl_complex *) x, 65,
  422.                     (scsl_complex *) y, 65, table, work, isys);
  423.  
  424.  
  425.      In this example, because _t_a_b_l_e__o_r_i_g is a stack variable that does not
  426.      persist outside of the code block delimited by the braces, the data in
  427.      the copy, _t_a_b_l_e, are not guaranteed to be valid. However, the following
  428.      code will work because _t_a_b_l_e__o_r_i_g is persistent:
  429.  
  430.           #include <scsl_fft.h>
  431.           scsl_complex x[131][65], y[131][65];
  432.           float table_orig[2*128 + 256];
  433.           float table[2*128 + 256];
  434.           float work[2*128];
  435.           int isys[2];
  436.           isys[0] = 1;
  437.           ccfftmr(0, 128, 64, 1.0f, (scsl_complex *) x, 65,
  438.                  (scsl_complex *) y, 65, table_orig, work, isys);
  439.           bcopy(table_orig, table, (2*128+256)*sizeof(float));
  440.           ccfftmr(1, 128, 64, 1.0f, (scsl_complex *) x, 65,
  441.                  (scsl_complex *) y, 65, table, work, isys);
  442.  
  443.  
  444. EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
  445.      The following examples are for Origin series only.
  446.  
  447.      Example 1:  Initialize the _t_a_b_l_e array in preparation for doing FFTs of
  448.      size 128.  Only the _i_s_i_g_n, _n, and _t_a_b_l_e arguments are used in this case.
  449.      You can use dummy arguments or zeros for the other arguments in the
  450.      subroutine call.
  451.  
  452.      Fortran:
  453.  
  454.            REAL TABLE(2*128 + 256)
  455.            CALL CCFFTMR(0, 128, 0, 0.0, DUMMY, 1, DUMMY, 1,
  456.  
  457.  
  458.  
  459.                                                                         PPPPaaaaggggeeee 7777
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466. CCCCCCCCFFFFFFFFTTTTMMMMRRRR((((3333SSSS))))                                                        CCCCCCCCFFFFFFFFTTTTMMMMRRRR((((3333SSSS))))
  467.  
  468.  
  469.  
  470.           &             TABLE, DUMMY, 0)
  471.  
  472.  
  473.      C/C++:
  474.  
  475.           #include <scsl_fft.h>
  476.           float table[2*128 + 256];
  477.           int isys[2];
  478.           isys[0] = 1;
  479.           ccfftmr(0, 128, 0, 0.0f, NULL, 1, NULL, 1,
  480.                  table, NULL, isys);
  481.  
  482.  
  483.      C++ STL:
  484.  
  485.           #include <complex.h>
  486.           #include <scsl_fft.h>
  487.           float table[2*128 + 256];
  488.           int isys[2];
  489.           isys[0] = 1;
  490.           ccfftmr(0, 128, 0, 0.0f, NULL, 1, NULL, 1,
  491.                   table, NULL, isys);
  492.  
  493.  
  494.      Example 2:  XXXX and YYYY are complex arrays  dimensioned (0...64) by
  495.      (0...130).  The first 64 elements of each column contain data.  For
  496.      performance reasons, the extra element forces the leading dimension to be
  497.      an odd number.  Take the FFT of the first 64 rows of XXXX and store the
  498.      results in the first 64 rows of YYYY.  Before taking the FFT, initialize the
  499.      TTTTAAAABBBBLLLLEEEE array, as in example 1.
  500.  
  501.      Fortran:
  502.  
  503.      COMPLEX X(0:64, 0:130)
  504.      COMPLEX Y(0:64, 0:130)
  505.      REAL TABLE(2*128 + 256)
  506.      REAL WORK(2*128)
  507.      INTEGER ISYS(0:1)
  508.      ISYS(0) = 1
  509.      CALL CCFFTMR(0, 128, 64, 1.0, X, 65, Y, 65, TABLE, WORK, ISYS)
  510.      CALL CCFFTMR(1, 128, 64, 1.0, X, 65, Y, 65, TABLE, WORK, ISYS)
  511.  
  512.  
  513.      C/C++:
  514.  
  515.           #include <scsl_fft.h>
  516.           scsl_complex x[131][65], y[131][65];
  517.           float table[2*128 + 256];
  518.           float work[2*128];
  519.           int isys[2];
  520.           isys[0] = 1;
  521.           ccfftmr(0, 128, 64, 1.0f, (scsl_complex *) x, 65,
  522.  
  523.  
  524.  
  525.                                                                         PPPPaaaaggggeeee 8888
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532. CCCCCCCCFFFFFFFFTTTTMMMMRRRR((((3333SSSS))))                                                        CCCCCCCCFFFFFFFFTTTTMMMMRRRR((((3333SSSS))))
  533.  
  534.  
  535.  
  536.                   (scsl_complex *) y, 65, table, work, isys);
  537.           ccfftmr(1, 128, 64, 1.0f, (scsl_complex *) x, 65,
  538.                   (scsl_complex *) y, 65, table, work, isys);
  539.  
  540.  
  541.      C++ STL:
  542.  
  543.           #include <complex.h>
  544.           #include <scsl_fft.h>
  545.           complex<float> x[131][65], y[131][65];
  546.           float table[2*128 + 128];
  547.           float work[2*128];
  548.           int isys[2];
  549.           isys[0] = 1;
  550.           ccfftmr(0, 128, 64, 1.0f, (complex<float> *) x, 65,
  551.                   (complex<float> *) y, 65, table, work, isys);
  552.           ccfftmr(1, 128, 64, 1.0f, (complex<float> *) x, 65,
  553.                   (complex<float> *) y, 65, table, work, isys);
  554.  
  555.  
  556.      Example 3:  With XXXX and YYYY as in example 2, take the inverse FFT of YYYY and
  557.      store it back in XXXX.  The _s_c_a_l_e factor 1/128 is used.  Assume that the
  558.      TTTTAAAABBBBLLLLEEEE array is already initialized.
  559.  
  560.      Fortran:
  561.  
  562.            CALL CCFFTMR(-1, 128, 64, 1.0/128.0, Y, 65, X, 65,
  563.           &             TABLE,WORK,0)
  564.  
  565.  
  566.      C/C++:
  567.  
  568.           ccfftmr(-1, 128, 64, 1.0f/128.0f, (scsl_complex *) y, 65,
  569.                  (scsl_complex *) x, 65, table, work, isys);
  570.  
  571.  
  572.      C++ STL:
  573.  
  574.      ccfftmr(-1, 128, 64, 1.0f/128.0f, (complex<float> *) y, 65,
  575.             (complex<float> *) x, 65, table, work, isys);
  576.  
  577.  
  578.      Example 4:  Perform the same computation as in example 4, but put the
  579.      output back in array _X to save storage space. Use the 8-byte integer
  580.      version of SCSL.
  581.  
  582.      Fortran:
  583.  
  584.            COMPLEX X(0:64, 0:130)
  585.            REAL TABLE(2*128 + 256)
  586.            REAL WORK(2*128)
  587.            INTEGER*8 ISYS(0:1)
  588.  
  589.  
  590.  
  591.                                                                         PPPPaaaaggggeeee 9999
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598. CCCCCCCCFFFFFFFFTTTTMMMMRRRR((((3333SSSS))))                                                        CCCCCCCCFFFFFFFFTTTTMMMMRRRR((((3333SSSS))))
  599.  
  600.  
  601.  
  602.            ISYS(0) = 1_8
  603.            CALL CCFFTMR(0_8, 128_8, 64_8, 1.0, X, 65_8, X, 65_8,
  604.           &             TABLE, WORK, ISYS)
  605.            CALL CCFFTMR(1_8, 128_8, 64_8, 1.0, X, 65_8, X, 65_8,
  606.           &             TABLE, WORK, ISYS)
  607.  
  608.  
  609.      C/C++:
  610.  
  611.           #include <scsl_fft_i8.h>
  612.           scsl_complex x[131][65], y[131][65];
  613.           float table[2*128 + 256];
  614.           float work[2*128];
  615.           long long isys[2];
  616.           isys[0] = 1LL;
  617.           ccfftmr(0LL, 128LL, 64LL, 1.0f, (scsl_complex *) x, 65LL,
  618.                  (scsl_complex *) x, 65LL, table, work, isys);
  619.           ccfftmr(1LL, 128LL, 64LL, 1.0f, (scsl_complex *) x, 65LL,
  620.                  (scsl_complex *) x, 65LL, table, work, isys);
  621.  
  622.  
  623.      C++ STL:
  624.  
  625.      #include <complex.h>
  626.      #include <scsl_fft_i8.h>
  627.      complex<float> x[131][65], y[131][65];
  628.      float table[2*128 + 256];
  629.      float work[2*128];
  630.      long long isys[2];
  631.      isys[0] = 1LL;
  632.      ccfftmr(0LL, 128LL, 64LL, 1.0f, (complex<float> *) x, 65LL,
  633.             (complex<float> *) x, 65LL, table, work, isys);
  634.      ccfftmr(1LL, 128LL, 64LL, 1.0f, (complex<float> *) x, 65LL,
  635.             (complex<float> *) x, 65LL, table, work, isys);
  636.  
  637.  
  638.      Example 5:  Perform the same computation as in example 2, but assume that
  639.      the lower bound of each Fortran array is 1, rather than 0.  The
  640.      subroutine calls are not changed.
  641.  
  642.      Fortran:
  643.  
  644.      COMPLEX X(65, 131)
  645.      COMPLEX Y(65, 131)
  646.      CALL CCFFTMR(0, 128, 64, 1.0, X, 65, Y, 65, TABLE, WORK, ISYS)
  647.      CALL CCFFTMR(1, 128, 64, 1.0, X, 65, Y, 65, TABLE, WORK, ISYS)
  648.  
  649.  
  650. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  651.      IIIINNNNTTTTRRRROOOO____FFFFFFFFTTTT(3S), IIIINNNNTTTTRRRROOOO____SSSSCCCCSSSSLLLL(3S), CCCCCCCCFFFFFFFFTTTT(3S), CCCCCCCCFFFFFFFFTTTTMMMM(3S), SSSSCCCCFFFFFFFFTTTT(3S),
  652.      SSSSCCCCFFFFFFFFTTTTMMMM(3S)
  653.  
  654.  
  655.  
  656.  
  657.                                                                        PPPPaaaaggggeeee 11110000
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664. CCCCCCCCFFFFFFFFTTTTMMMMRRRR((((3333SSSS))))                                                        CCCCCCCCFFFFFFFFTTTTMMMMRRRR((((3333SSSS))))
  665.  
  666.  
  667.  
  668.  
  669.  
  670.  
  671.  
  672.  
  673.  
  674.  
  675.  
  676.  
  677.  
  678.  
  679.  
  680.  
  681.  
  682.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.                                                                        PPPPaaaaggggeeee 11111111
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.